/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package GUI;

/**
 *
 * @author PTHUONG
 */
public class frmMain extends javax.swing.JFrame {

    /**
     * Creates new form frmMain
     */
    public frmMain() {
        initComponents();
        this.setResizable(false);
//        frmDN.setVisible(true);
//        this.jDesktopPaneMain.add(frmDN);
    }
    frm_JInternalFrameDangNhap frmDN = new frm_JInternalFrameDangNhap();
    frm_JInterFrameQuanLyBanVe frmBVe = new frm_JInterFrameQuanLyBanVe();
    frm_JInterFrameQuanLyPhim frmPhim = new frm_JInterFrameQuanLyPhim();
    frm_JInterFrameQuanLyPhong frmPhong = new frm_JInterFrameQuanLyPhong();
    frm_JInterFrameQuanLyLichChieu frmLichChieu = new frm_JInterFrameQuanLyLichChieu();

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jDesktopPane1 = new javax.swing.JDesktopPane();
        jDesktopPaneMain = new javax.swing.JDesktopPane();
        jMenuBar1 = new javax.swing.JMenuBar();
        jMenuHeThong = new javax.swing.JMenu();
        jMenuItemDangNhap = new javax.swing.JMenuItem();
        jMenuItemDangXuat = new javax.swing.JMenuItem();
        jMenuItemThoat = new javax.swing.JMenuItem();
        jMenuQLVe = new javax.swing.JMenu();
        jMenuChucNang = new javax.swing.JMenu();
        jMenuItemPhim = new javax.swing.JMenuItem();
        jMenuItemPhong = new javax.swing.JMenuItem();
        jMenuItemLichChieu = new javax.swing.JMenuItem();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setBackground(new java.awt.Color(204, 204, 255));

        jDesktopPaneMain.setBackground(new java.awt.Color(51, 51, 255));
        getContentPane().add(jDesktopPaneMain, java.awt.BorderLayout.CENTER);

        jMenuHeThong.setText("Hệ thống");

        jMenuItemDangNhap.setText("Đăng nhập");
        jMenuItemDangNhap.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemDangNhapActionPerformed(evt);
            }
        });
        jMenuHeThong.add(jMenuItemDangNhap);

        jMenuItemDangXuat.setText("Đăng xuất");
        jMenuHeThong.add(jMenuItemDangXuat);

        jMenuItemThoat.setText("Thoát");
        jMenuHeThong.add(jMenuItemThoat);

        jMenuBar1.add(jMenuHeThong);

        jMenuQLVe.setText("Quản lý bán vé");
        jMenuQLVe.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jMenuQLVeMouseClicked(evt);
            }
        });
        jMenuBar1.add(jMenuQLVe);

        jMenuChucNang.setText("Chức năng");

        jMenuItemPhim.setText("Quản lý Phim");
        jMenuItemPhim.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemPhimActionPerformed(evt);
            }
        });
        jMenuChucNang.add(jMenuItemPhim);

        jMenuItemPhong.setText("Quản lý Phòng");
        jMenuItemPhong.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemPhongActionPerformed(evt);
            }
        });
        jMenuChucNang.add(jMenuItemPhong);

        jMenuItemLichChieu.setText("Quản lý Lịch chiếu");
        jMenuItemLichChieu.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemLichChieuActionPerformed(evt);
            }
        });
        jMenuChucNang.add(jMenuItemLichChieu);

        jMenuBar1.add(jMenuChucNang);

        setJMenuBar(jMenuBar1);

        java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
        setBounds((screenSize.width-816)/2, (screenSize.height-688)/2, 816, 688);
    }// </editor-fold>//GEN-END:initComponents

    private void jMenuItemDangNhapActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemDangNhapActionPerformed
        // TODO add your handling code here:
        frmDN.setVisible(true);
        this.jDesktopPaneMain.add(frmDN);
    }//GEN-LAST:event_jMenuItemDangNhapActionPerformed

    private void jMenuQLVeMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jMenuQLVeMouseClicked
        // TODO add your handling code here:
        if (frmDN.isDisplayable() == true || frmLichChieu.isDisplayable() == true || frmPhong.isDisplayable() == true || frmPhim.isDisplayable() == true) {
            frmDN.hide();
            frmLichChieu.hide();
            frmPhim.hide();
            frmPhong.hide();
            frmBVe.setVisible(true);
            this.jDesktopPaneMain.add(frmBVe);
        }
        else{
            frmBVe.setVisible(true);
            this.jDesktopPaneMain.add(frmBVe);
        }
    }//GEN-LAST:event_jMenuQLVeMouseClicked

    private void jMenuItemPhimActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemPhimActionPerformed
        // TODO add your handling code here:
        if (frmDN.isDisplayable() == true || frmLichChieu.isDisplayable() == true || frmPhong.isDisplayable() == true || frmBVe.isDisplayable() == true) {
            frmDN.hide();
            frmLichChieu.hide();
            frmBVe.hide();
            frmPhong.hide();
            frmPhim.setVisible(true);
            this.jDesktopPaneMain.add(frmPhim);
        }
        else{
            frmPhim.setVisible(true);
            this.jDesktopPaneMain.add(frmPhim);
        }
    }//GEN-LAST:event_jMenuItemPhimActionPerformed

    private void jMenuItemPhongActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemPhongActionPerformed
        // TODO add your handling code here:
        if (frmDN.isDisplayable() == true || frmLichChieu.isDisplayable() == true || frmPhim.isDisplayable() == true || frmBVe.isDisplayable() == true) {
            frmDN.hide();
            frmLichChieu.hide();
            frmBVe.hide();
            frmPhim.hide();
            frmPhong.setVisible(true);
            this.jDesktopPaneMain.add(frmPhong);
        }
        else{
        frmPhong.setVisible(true);
            this.jDesktopPaneMain.add(frmPhong);
        }
    }//GEN-LAST:event_jMenuItemPhongActionPerformed

    private void jMenuItemLichChieuActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemLichChieuActionPerformed
        // TODO add your handling code here:
        if (frmDN.isDisplayable() == true || frmPhim.isDisplayable() == true || frmPhong.isDisplayable() == true || frmBVe.isDisplayable() == true) {
            frmDN.hide();
            frmPhim.hide();
            frmBVe.hide();
            frmPhong.hide();
            frmLichChieu.setVisible(true);
            this.jDesktopPaneMain.add(frmLichChieu);
        }
        else{
            frmLichChieu.setVisible(true);
            this.jDesktopPaneMain.add(frmLichChieu);
        }
    }//GEN-LAST:event_jMenuItemLichChieuActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {

        /*
         * Set the Nimbus look and feel
         */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /*
         * If Nimbus (introduced in Java SE 6) is not available, stay with the
         * default look and feel. For details see
         * http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(frmMain.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(frmMain.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(frmMain.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(frmMain.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /*
         * Create and display the form
         */
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new frmMain().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JDesktopPane jDesktopPane1;
    private javax.swing.JDesktopPane jDesktopPaneMain;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JMenu jMenuChucNang;
    private javax.swing.JMenu jMenuHeThong;
    private javax.swing.JMenuItem jMenuItemDangNhap;
    private javax.swing.JMenuItem jMenuItemDangXuat;
    private javax.swing.JMenuItem jMenuItemLichChieu;
    private javax.swing.JMenuItem jMenuItemPhim;
    private javax.swing.JMenuItem jMenuItemPhong;
    private javax.swing.JMenuItem jMenuItemThoat;
    private javax.swing.JMenu jMenuQLVe;
    // End of variables declaration//GEN-END:variables
}
